package com.chis.ms;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 
 * @Description 
 * @Company zwx
 * @author wlj
 * @version 2019年04月25日
 */
public class Diws {

    public static void main(String[] args) {
        traverseFolder("C:\\Users\\wlj\\Desktop\\111\\2021-04-19");




    }
    public static void traverseFolder(String path) {
        File file = new File(path);
        if (file.exists()) {
            File[] files = file.listFiles();
            if (null == files || files.length == 0) {
                return;
            } else {
                for (File file2 : files) {
                    if (file2.isDirectory()) {
                        traverseFolder(file2.getAbsolutePath());
                    } else {
                        if (file2.getAbsolutePath().endsWith(".xml")) {
                            tt(file2.getAbsolutePath());
                        }
                    }
                }
            }
        } else {
            System.out.println("文件不存在!");
        }
    }

    public static void tt(String path) {
        File file1 = new File(path);
        FileReader m = null;
        try {
            m = new FileReader(file1);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        BufferedReader reader = new BufferedReader(m);

        while (true) {
            String nextline = null;
            try {
                nextline = reader.readLine();
                if (nextline != null && nextline.length() > 8) {
//                    System.out.println(nextline);
                    if(nextline.contains("8312949c6c243baa77ea943fa07be61")){
                        System.out.println(path);
                    }

                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (nextline == null) break;
        }

    }

}
